#include "cpu/exec/template-start.h"

#define instr cmp

static void do_execute() {
	DATA_TYPE res = op_dest->val - op_src->val;
    update_eflags_pf_zf_sf((DATA_TYPE_S)res);
    //CF针对无符号数（都视作无符号数）
    cpu.eflags.CF = op_dest->val < op_src->val;
    int s1 = op_dest->val >> ((DATA_BYTE << 3) - 1);
    int s2 = op_src->val >> ((DATA_BYTE << 3) - 1);
    //OF针对有符号数（都视作有符号数）
    cpu.eflags.OF = (s1 != s2 && s2 == cpu.eflags.SF);
	print_asm_template2();
}


make_instr_helper(i2a);
make_instr_helper(i2rm);
//用于预处理时决定插不插入某部分代码
#if DATA_BYTE == 2 || DATA_BYTE == 4   //si2rm  只有_w和_l
make_instr_helper(si2rm);
#endif
make_instr_helper(r2rm);
make_instr_helper(rm2r);


#include "cpu/exec/template-end.h"


